package git.soulbgm.common.pojo;

/**
 * 前端分页查询的统一格式
 *
 * @author SoulBGM
 * @version 1.0
 * @date 2019-11-22 17:18:45
 */
public class PageInfo {

    /**
     * 当前页码
     */
    private int pageNum = 1;

    /**
     * 每页显示条数
     */
    private int pageSize = 10;

    /**
     * 数据总数
     */
    private long totalCount;

    /**
     * 总页数
     */
    private long totalPage;

    /**
     * 当前页数据
     */
    private Object data;

    public PageInfo() {
    }

    public static PageInfo getPageInfo(int pageNum, int pageSize, long totalCount, long totalPage, Object data) {
        return new PageInfo(pageNum, pageSize, totalCount, totalPage, data);
    }

    public PageInfo(int pageNum, int pageSize, long totalCount, long totalPage, Object data) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        this.totalPage = totalPage;
        this.data = data;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public long getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(long totalPage) {
        this.totalPage = totalPage;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
